//package com.cloud.mall.config;
//
//import com.github.benmanes.caffeine.cache.Caffeine;
//import org.springframework.boot.autoconfigure.cache.CacheProperties;
//import org.springframework.cache.annotation.EnableCaching;
//import org.springframework.cache.caffeine.CaffeineCacheManager;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//
//import java.util.concurrent.TimeUnit;
//
///**
// * @Author: 梁二东
// * @Date: 2024/12/4 14:55
// * @Description:
// **/
//@Configuration
//@EnableCaching
//public class CacheConfig {
//    @Bean
//    public CaffeineCacheManager cacheManager() {
//        CaffeineCacheManager cacheManager = new CaffeineCacheManager();
//        cacheManager.setCaffeine(caffeineConfig().build());
//        return cacheManager;
//    }
//
//    private CacheProperties.Caffeine<Object, Object> caffeineConfig() {
//        return Caffeine.newBuilder()
//                .initialCapacity(100)
//                .maximumSize(500)
//                .expireAfterWrite(10, TimeUnit.MINUTES)
//                .weakKeys();
//    }
//}
